<!--
 * @FilePath     : /study_code/css/point-event.html
 * @Description  : point-event 属性
 * @Date         : 2025-04-28 10:15:32
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-28 10:15:32
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
    <style>
      .topbox,
      .bottombox {
        width: 100px;
        height: 60px;
        position: absolute;
      }

      .topbox {
        background: rgba(187, 23, 212, 0.4);
        top: 20px;
        left: 20px;
        z-index: 9;
        pointer-events: none;
      }
      .bottombox {
        background: rgba(36, 172, 242, 0.4);
        z-index: 3;
      }

      /*
      demo中：不加 pointer-events: none; 属性时，点击 .topbox 是不触发后面的 .bottombox 事件的。
      加了，点击重叠部分的红色，也会触发后面的事件。
      */
    </style>
  </head>
  <body>
    <div class="topbox" onclick="clickHandle2()"></div>
    <div class="bottombox" onclick="clickHandle()"></div>

    <script>
      function clickHandle() {
        console.log('bottombox')
      }
      function clickHandle2() {
        console.log('topbox')
      }
    </script>
  </body>
</html>
